<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Throtting</title>
</head>
<body>
    <input type="text" id="text">
    <script>
        function throtting(fn, delay){
            var t, isStart = false;
            return function(...args){
                if(isStart){
                    return;
                }
                isStart = true;
                clearInterval(t);
                t = setTimeout(() => {
                    fn.call(this, ...args);
                    isStart = false;
                }, delay);
            }
        }
        text.addEventListener('input', throtting(function(ev){
            console.log(ev, this);
        }, 500), false)
        // 0 16 0.01 10
        // 0 1600  1  1000
    </script>
</body>
</html>